// 分类Schema设计

var mongoose = require('mongoose'),
  Schema = mongoose.Schema;

// Schema建模
var CategorySchema = new Schema({
    // 分类名称
    name: {type: String, required: true},
    // URL名称
    slug: {type: String, required: true},
    // 分类创建时间
    created: {type: Date, default: Date.now}
});

// 生成Model
mongoose.model('Category', CategorySchema);

